package mapEditor.view
{
	import iso.IsoPoint;
	import iso.IsoSprite;

	public class MapRoadPoint extends IsoSprite
	{
		public function MapRoadPoint(cellSize:Number, ipt:IsoPoint=null)
		{
			mouseEnabled=false;
			graphics.clear();
			graphics.lineStyle(0, 0, 0);
			graphics.beginFill(0xFF0000, 0.8);
			graphics.moveTo(-cellSize, cellSize/2);
			graphics.lineTo(0, 0);
			graphics.lineTo(cellSize, cellSize/2);
			graphics.lineTo(0, cellSize);
			graphics.lineTo(-cellSize, cellSize/2);
			graphics.endFill();
			
			ipt.x=Math.floor(ipt.x/cellSize)*cellSize;
			ipt.y=Math.floor(ipt.y/cellSize)*cellSize;
			ipt.z=Math.floor(ipt.z/cellSize)*cellSize;
			position=ipt;
		}
		
		override public function dispose():void
		{
			super.dispose();
			if(parent) parent.removeChild(this);
		}
	}
}